package co.yixiang.modules.shop.service;

import co.yixiang.modules.order.web.dto.CacheDTO;
import co.yixiang.modules.order.web.dto.InvestCacheDTO;
import co.yixiang.modules.order.web.dto.InvestOrderCountDTO;
import co.yixiang.modules.order.web.param.InvestOrderParam;
import co.yixiang.modules.shop.entity.YxInvestOrder;
import co.yixiang.common.service.BaseService;
import co.yixiang.modules.shop.web.param.YxInvestOrderQueryParam;
import co.yixiang.modules.shop.web.vo.YxInvestCartQueryVo;
import co.yixiang.modules.shop.web.vo.YxInvestOrderQueryVo;
import co.yixiang.common.web.vo.Paging;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 认购订单表 服务类
 * </p>
 *
 * @author hisen
 * @since 2020-06-10
 */
public interface YxInvestOrderService extends BaseService<YxInvestOrder> {

    /**
     * 根据ID获取查询对象
     * @param id
     * @return
     */
    YxInvestOrderQueryVo getYxInvestOrderById(Serializable id) throws Exception;

    /**
     * 获取分页对象
     * @param yxInvestOrderQueryParam
     * @return
     */
    Paging<YxInvestOrderQueryVo> getYxInvestOrderPageList(YxInvestOrderQueryParam yxInvestOrderQueryParam) throws Exception;

    String cacheOrderInfo(int uid, List<YxInvestCartQueryVo> cartInfo, Double price);

    YxInvestOrderQueryVo getOrderInfo(String unique,int uid);

    YxInvestOrder getOrderInfo(String unique);


    /*
   * 创建订单
   * @param uid uid
   * @param key key
   * @param param param
   * @return
           */
    YxInvestOrder createOrder(int uid, String key, InvestOrderParam param);

    InvestCacheDTO getCacheOrderInfo(int uid, String key);

    void delCacheOrderInfo(int uid, String key);

    /**
     * 个人数据
     * @param uid
     * @return
     */
    InvestOrderCountDTO orderData(int uid);

    /**
     * 团队数据
     * @param uid
     * @param saleId
     * @return
     */
    InvestOrderCountDTO orderDataTeam(int uid, List<Integer> saleId);


    /**
     * 订单列表(个人)
     * @param uid 业务员id
     * @param investPhone  认购者手机号
     * @param type 订单类型
     * @param page
     * @param limit
     * @return
     */
    List<YxInvestOrderQueryVo> orderList(int uid,String investPhone,int type,int page,int limit);

    /**
     * 订单列表(团队)
     * @param uid 业务员id
     * @param investPhone  认购者手机号
     * @param type 订单类型
     * @param page
     * @param limit
     * @return
     */
    List<YxInvestOrderQueryVo> orderListTeam(int uid,String investPhone,int type,int page,int limit, List<Integer> saleId);

    YxInvestOrderQueryVo handleOrder(YxInvestOrderQueryVo order);

}
